//
//  KWNHomeViewController.m
//  KWNClient
//
//  Created by 张明磊 on 14-4-15.
//  Copyright (c) 2014年 张明磊. All rights reserved.
//

#import "KWNHomeViewController.h"
#import "KWNSliderViewController.h"
#import "KWNDetailViewController.h"

@interface KWNHomeViewController ()

@end

@implementation KWNHomeViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
      
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.view.backgroundColor = RGB(227, 227, 227);
    
    [self install_homeView_UI];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)install_homeView_UI
{
    UIImageView *imageView_title = [[UIImageView alloc] initWithFrame:CGRectMake(0, -20 + IOS7_SIZE, self.view.frame.size.width, 64)];
    [imageView_title setImage:[UIImage imageFileName:@"imageView_homeTitle.png"]];
    [self.view addSubview:imageView_title];
    
    UIButton *button_menu = [UIButton buttonWithType:UIButtonTypeCustom];
    button_menu.frame = CGRectMake(0, IOS7_SIZE, 60, 45);
    [button_menu setImage:[UIImage imageFileName:@"button_menu.png"] forState:UIControlStateNormal];
    [button_menu addTarget:self action:@selector(didClickButton_menu:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button_menu];
    
    UIButton *button_receive = [UIButton buttonWithType:UIButtonTypeCustom];
    button_receive.frame = CGRectMake(imageView_title.frame.size.width - 60, button_menu.frame.origin.y, 60, 45);
    button_receive.backgroundColor = [UIColor clearColor];
    [button_receive setImage:[UIImage imageFileName:@"button_receive.png"] forState:UIControlStateNormal];
    [button_receive addTarget:self action:@selector(didClickButton_receive:)forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button_receive];
}

- (void)didClickButton_menu:(UIButton *)button_menu
{
    [[KWNSliderViewController sharedController] showLeftController:YES];
}

- (void)didClickButton_ask:(UIButton *)button_ask
{
    KWNDetailViewController *detail = [[KWNDetailViewController alloc] init];
    [self pushViewController:detail];
}

- (void)didClickButton_receive:(UIButton *)button_receive
{
    
}

@end
